﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;

namespace ESCUtils
{
    public class AppVariable
    {
        public static string dbstr { get; set; }

        public static string Werk
        {
            get
            {
                if (dbstr == "Teapo")
                    return "5210";
                else
                    return "5133";
            }
        }
        public static decimal InStockPer
        {
            get
            {
                if (dbstr == "Teapo")
                    return 1.05m;
                else
                    return 1.08m;
            }
        }

        public static bool IsJamicon
        {
            get
            {
                if (dbstr == "Jamicon")
                    return true;
                else
                    return false;
            }
        }
        public static bool IsTeapo
        {
            get
            {
                if (dbstr == "Teapo")
                    return true;
                else
                    return false;
            }
        }

        public static string FQC
        {
            get
            {
                if (dbstr == "Jamicon")
                    return "5500";
                else
                    return "8000";
            }
        }
        public static string FQCName
        {
            get
            {
                if (dbstr == "Jamicon")
                    return "QA";
                else
                    return "FQC";
            }
        }

        public static string CheckTagStr
        {
            get
            {
                if (dbstr == "Jamicon")
                    return "JSU";
                else
                    return "TDG";
            }
        }

        public static string CheckTagEIStr
        {
            get
            {
                if (dbstr == "Jamicon")
                    return "JZG";
                else
                    return "TZG";
            }
        }

        public static string CheckTagWGStr
        {
            get
            {
                if (dbstr == "Jamicon")
                    return "JCG";
                else
                    return "TCG";
            }
        }

        public static string FileUrl
        {
            get
            {
                if (dbstr == "Jamicon")
                    return ConfigurationManager.AppSettings["PrintFileAddressSu"];
                else
                    return ConfigurationManager.AppSettings["PrintFileAddress"];
            }
        }

        public static string StockStr
        {
            get
            {
                if (dbstr == "Jamicon")
                    return "J";
                else
                    return "T";
            }
        }


        public static string CutStockStr
        {
            get
            {
                if (dbstr == "Jamicon")
                    return "JSA";
                else
                    return "TDA";
            }
        }
        public static string POLVC
        {
            get
            {
                if (dbstr == "Jamicon")
                    return "VC";
                else
                    return "POL";
            }
        }

        public static string PrintTitle
        {
            get
            {
                if (dbstr == "Jamicon")
                    return "凱美電子（蘇州）有限公司-正式區";
                else
                    return "智寶電子（東莞）有限公司-正式區";
            }
        }

		public static string ConvertABC(string str)
		{
			if (str.EndsWith("R"))
			{
				str = str.Replace("R", ".5");
			}
			else if (str.EndsWith("A"))
			{
				str = str.Replace("A", ".7");
			}
			else if (str.EndsWith("B"))
			{
				str = str.Replace("B", ".8");
			}
			else if (str.EndsWith("C"))
			{
				str = str.Replace("C", ".2");
			}
			else if (str.EndsWith("D"))
			{
				str = str.Replace("D", ".4");
			}
			else if (str.EndsWith("E"))
			{
				str = str.Replace("E", ".9");
			}
			else if (str.EndsWith("F"))
			{
				str = str.Replace("F", ".3");
			}
			else if (str.EndsWith("G"))
			{
				str = str.Replace("G", ".45");
			}
			else if (str.EndsWith("H"))
			{
				str = str.Replace("H", ".1");
			}
			else if (str.EndsWith("J"))
			{
				str = str.Replace("J", ".6");
			}
			return str;
		}
	}
}
